package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CheckDetailMapper;
import com.ruoyi.system.domain.CheckDetail;
import com.ruoyi.system.service.ICheckDetailService;

import javax.annotation.Resource;

/**
 * 验收详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-11
 */
@Service
public class CheckDetailServiceImpl implements ICheckDetailService {
    @Resource
    private CheckDetailMapper checkDetailMapper;

    /**
     * 查询验收详情
     *
     * @param id 验收详情主键
     * @return 验收详情
     */
    @Override
    public CheckDetail selectCheckDetailById(Long id) {
        return checkDetailMapper.selectCheckDetailById(id);
    }

    /**
     * 查询验收详情列表
     *
     * @param checkDetail 验收详情
     * @return 验收详情
     */
    @Override
    public List<CheckDetail> selectCheckDetailList(CheckDetail checkDetail) {
        return checkDetailMapper.selectCheckDetailList(checkDetail);
    }

    /**
     * 新增验收详情
     *
     * @param checkDetail 验收详情
     * @return 结果
     */
    @Override
    public int insertCheckDetail(CheckDetail checkDetail) {
        checkDetail.setCreateTime(DateUtils.getNowDate());
        return checkDetailMapper.insertCheckDetail(checkDetail);
    }

    /**
     * 修改验收详情
     *
     * @param checkDetail 验收详情
     * @return 结果
     */
    @Override
    public int updateCheckDetail(CheckDetail checkDetail) {
        checkDetail.setUpdateTime(DateUtils.getNowDate());
        return checkDetailMapper.updateCheckDetail(checkDetail);
    }

    /**
     * 批量删除验收详情
     *
     * @param ids 需要删除的验收详情主键
     * @return 结果
     */
    @Override
    public int deleteCheckDetailByIds(Long[] ids) {
        return checkDetailMapper.deleteCheckDetailByIds(ids);
    }

    /**
     * 删除验收详情信息
     *
     * @param id 验收详情主键
     * @return 结果
     */
    @Override
    public int deleteCheckDetailById(Long id) {
        return checkDetailMapper.deleteCheckDetailById(id);
    }
}
